home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-01-29 | 13.3 KB | 517 lines | [TEXT/MPS ] |
- ; Version: 2.54
- ; Created: Thursday, August 3, 1989 at 6:28:07 PM
- ;
- ; File: SlotEqu.a
- ;
- ; Assembler Interface to the Macintosh Libraries
- ; Copyright Apple Computer, Inc. 1986-1991
- ; All Rights Reserved
- ;
- ;--------------------------------------------------------------------
-
- IF &TYPE('__IncludingSlotEqu__') = 'UNDEFINED' THEN
- __IncludingSlotEqu__ SET 1
-
- IF &TYPE('__IncludingTraps__') = 'UNDEFINED' THEN ; get defintion of _SlotManager
- INCLUDE 'Traps.a'
- ENDIF
-
- ; sInfo Array status flags (StatusFlags) in bit numbers
-
- fDontUse EQU 0 ; old slotmgr put fcardIsChanged here
- fCardIsChanged EQU 1 ; card is Changed field in StatusFlags field of sInfoArray
- fTempEnabled EQU 2 ; slot is temporarily enabled
-
- ; spBlock flags (spFlags)
-
- fCkForNext EQU $00 ; check for NEXT sRsrc in SRT (SearchSRT)
- fCkReserved EQU $01 ; check reserved field for zero (ReadPBSize)
- fWarmStart EQU $02 ; warm start, else cold start (PrimaryInit)
- fClear EQU $03 ; clear the memory (sNewPtr)
- fSys EQU $04 ; alloc on system heap (sNewPtr)
- fConsecBytes EQU $05 ; calc step value for consecutive bytes (CalcStep)
-
- ; flag bits for spParamData
-
- fAll EQU 0 ; bit 0: set=search enabled/disabled sRsrc's
- fOneSlot EQU 1 ; 1: set=search sRsrc's in given slot only
- fNext EQU 2 ; 2: set=search for next sRsrc
-
- ; sResource flags (sRsrc_Flags) - flags 8-15 are entered into srt flags field
-
- fOpenAtStart EQU 1 ; open the driver at start time, else do not
- f32BitMode EQU 2 ; a 32-bit address will be put into dctlDevBase
-
- ; state constants for sInfoRecord
-
- stateNil EQU 0 ; uninitialized sInfoRecord
- stateSDMInit EQU 1 ; sInfoRecord initialized - executed InitSDeclMgr
- statePRAMInit EQU 2 ; sPRAM record initialized - executed InitSPRAMRec
- statePInit EQU 3 ; primary Init executed
- stateSInit EQU 4 ; secondary init executed
-
- ;Misc masks <6>
-
- catMask EQU $08 ; sets spCategory field of spTBMask (bit 3)
- cTypeMask EQU $04 ; sets spCType field of spTBMask (bit 2)
- drvrSWMask EQU $02 ; sets spDrvrSW field of spTBMask (bit 1)
- drvrHWMask EQU $01 ; sets spDrvrHW field of spTBMask (bit 0)
-
- ;Misc constants
-
- sizeSPRAMRec EQU 8 ; size of sPRAM record
- smPRAMTop EQU $46 ; address of beginning of slot PRAM area
- majorSpace EQU $90 ; high byte of beginning of major space
-
- TotalSlots EQU 15 ; number of slot supported
- minorLast EQU $FEFFFFFF ; last minor slot addr
- FirstPRAMSlot EQU $9 ; First slot with PRAM allocated
- sNumSlots EQU 6 ; used for number of slot interrupts supported on via
- sFirstSlot EQU $9 ; First slot supported
- sLastSlot EQU $E ; The last slot.
- minorStep EQU $01000000 ; value to step minor address to next slot
- retryCnt EQU 100 ; default retry cnt on a Nubus read bus error
-
- lastSDMSelt EQU $3D ;The last SDM selector
-
- ;
- ; Slot interrupt queue element - Used to install a slot interrupt handler by sInitInstall
- ;
-
- SlotIntQElement RECORD 0
- sqLink DS.L 1 ; Ptr - ptr to next element
- sqType DS.W 1 ; INTEGER - queue type ID for validity
- sqPrio DS.W 1 ; INTEGER - priority
- sqAddr DS.L 1 ; ProcPtr - interrupt service routine
- sqParm DS.L 1 ; LONGINT - optional A1 parameter
- sqHDSize EQU * ; size of slot queue header element
- ENDR
-
- ;
- ; Slot Parameter Block - parameter block to all slot manager routines. All fields
- ; may be inputs, or outputs.
- ;
-
- SpBlock RECORD 0
- spResult DS.L 1 ; result
- spSPointer DS.L 1 ; general pointer
- spSize DS.L 1 ; size
- spOffsetData DS.L 1 ; Offset/Data field value (sOffsetData)
- spIOFileName DS.L 1 ; Pointer to IOFile name (not used)
- spSExecPBlk DS.L 1 ; Pointer to sExec block
- spParamData DS.L 1 ; misc parameter data (formerly spStackPtr)
- spMisc DS.L 1 ; Misc field for SDM (not used)
- spReserved DS.L 1 ; Reserved for future expansion
- spIOReserved DS.W 1 ; Reserved field of SRT
- spRefNum DS.W 1 ; RefNum
- spCategory DS.W 1 ; sResource category
- spCType DS.W 1 ; type
- spDrvrSW DS.W 1 ; drvrsw
- spDrvrHW DS.W 1 ; drvrhw
- spTBMask DS.B 1 ; type bit mask (bit 0 set = ignore drvrhw, bit 1 = drvrsw, ...)
- spSlot DS.B 1 ; slot number.
- spId DS.B 1 ; sResource id
- spExtDev DS.B 1 ; external device id
- spHwDev DS.B 1 ; hardware device id
- spByteLanes DS.B 1 ; bytelanes value from FHeader in the declaration ROM.
- spFlags DS.B 1 ; general flags
- spKey DS.B 1 ; reserved (not used)
- spBlockSize EQU * ; Size of spBlock
- ENDR
-
- ;
- ; sInfo Record - general slot information. A record exists for each slot
-
-
- SInfoRecord RECORD 0 ;Slot information record. sInfo Array[1..NumSlots]
- siDirPtr DS.L 1 ; Pointer to directory
- siInitStatusA DS.W 1 ; Fundamental Error
- siInitStatusV DS.W 1 ; Status returned by vendor Init code
- siState DS.B 1 ; Initialization State (Primary, Secondary)
- siCPUByteLanes DS.B 1 ; CPU Byte Lanes. Each bit set signifies a byte-lane used.
- siTopOfROM DS.B 1 ; Top of ROM = $FssFFFFx, where x is TopOfROM.
- siStatusFlags DS.B 1 ; Bit-0:Card is changed
- siTOConst DS.W 1 ; Time Out Constant for BusErr
- siReserved DS.B 2 ; Reserved, must be 0
- sInfoRecSize EQU * ; Size of sInfoRecord
- siROMAddr DS.L 1 ; Address of top of ROM (major or minor space)
- siSlot DS.B 1 ; slot number
- siPadding DS.B 3 ; padding to bring out to next long
- sInfoNewSize EQU * ; size of new sInfo record
- ENDR
-
- FHeaderRec RECORD 0
- fhDirOffset DS.L 1 ;Offset to directory
- fhLength DS.L 1 ;Length of ROM
- fhCRC DS.L 1 ;CRC
- fhROMRev DS.B 1 ;Revision of ROM
- fhFormat DS.B 1 ;Format-2
- fhTstPat DS.L 1 ;TestPattern
- fhReserved DS.B 1 ;Reserved
- fhByteLanes DS.B 1 ;ByteLanes
- fhBlockSize EQU *
- ENDR
-
- OffsetToDir EQU FHeaderRec.fhDirOffset-FHeaderRec.fhBlockSize+1
- ; offset to dir ptr
-
- SEBlock RECORD 0 ;Parameter block for code executed by sExec.
- ;------- elements of all seBlocks ------
- seSlot DS.B 1 ; Slot number.
- seSRsrcId DS.B 1 ; sResource Id.
- seStatus DS.W 1 ; Status of code executed by sExec.
- seFlags DS.B 1 ; Flags.
- seFiller DS.B 3 ; Filler
- ;------- extensions for sLoad + sBoot ------
- seResult DS.L 1 ; Result of sLoad.
- seIOFileName DS.L 1 ; Pointer to IOFile name.
- seDevice DS.B 1 ; Which device to read from.
- sePartition DS.B 1 ; The partition.
- seOSType DS.B 1 ; Type of OS.
- seReserved DS.B 1 ; Reserved field.
- seRefNum DS.B 1 ; RefNum of the driver.
- ;------- extensions for sBoot ------
- seNumDevices DS.B 1 ; Number of devices to load.
- seBootState DS.B 1 ; State of StartBoot code.
- ALIGN 2
- seBlockSize EQU * ; Size of se parameter Block
- ENDR
-
- ; Slot Manager Selectors:
- ;
- ; PRINCIPLE
-
- sReadByte EQU $00
- sReadWord EQU $01
- sReadLong EQU $02
- sGetCString EQU $03
- sGetBlock EQU $05
- sFindStruct EQU $06
- sReadStruct EQU $07
- sVersion EQU $08
- sSetSRsrcState EQU $09
- sInsertSRTRec EQU $0A
- sGetSRsrc EQU $0B
- sGetTypeSRsrc EQU $0C
-
- ; SPECIAL
- sReadInfo EQU $10
- sReadPRAMRec EQU $11
- sPutPRAMRec EQU $12
- sReadFHeader EQU $13
- sNextSRsrc EQU $14
- sNextTypeSRsrc EQU $15
- sRsrcInfo EQU $16
- sDisposePtr EQU $17
- sCkCardStat EQU $18
- sReadDrvrName EQU $19
- sFindSRTRec EQU $1A
- sFindDevBase EQU $1B
- sFindBigDevBase EQU $1C
- sGetSRsrcPtr EQU $1D
-
- ; Advanced
- initSDeclMgr EQU $20
- sPrimaryInit EQU $21
- sCardChanged EQU $22
- sExec EQU $23
- sOffsetData EQU $24
- sInitPRAMRecs EQU $25
- sReadPBSize EQU $26
-
- sCalcStep EQU $28
- sInitSRsrcTable EQU $29
- sSearchSRT EQU $2A
- sUpdateSRT EQU $2B
- sCalcSPointer EQU $2C
- sGetDriver EQU $2D
- sPtrToSlot EQU $2E
- sFindSInfoRecPtr EQU $2F
- sFindSRsrcPtr EQU $30
- sDeleteSRTRec EQU $31
- sSecondaryInit EQU $32
- sInitSlotPRAM EQU $33
-
-
- ;#####################################################################
- ; PRINCIPLE
- ;#####################################################################
-
- MACRO
- _SReadByte
- MOVEQ #sReadByte,D0
- _SlotManager
- ENDM
-
- MACRO
- _SReadWord
- MOVEQ #sReadWord,D0
- _SlotManager
- ENDM
-
- MACRO
- _SReadLong
- MOVEQ #sReadLong,D0
- _SlotManager
- ENDM
-
- MACRO
- _SGetCString
- MOVEQ #sGetCString,D0
- _SlotManager
- ENDM
-
- MACRO
- _SGetBlock
- MOVEQ #sGetBlock,D0
- _SlotManager
- ENDM
-
- MACRO
- _SFindStruct
- MOVEQ #sFindStruct,D0
- _SlotManager
- ENDM
-
- MACRO
- _SReadStruct
- MOVEQ #sReadStruct,D0
- _SlotManager
- ENDM
-
- MACRO
- _SVersion
- MOVEQ #sVersion,D0
- _SlotManager
- ENDM
-
- MACRO
- _SetSRsrcState
- MOVEQ #sSetSRsrcState,D0
- _SlotManager
- ENDM
-
- MACRO
- _InsertSRTRec
- MOVEQ #sInsertSRTRec,D0
- _SlotManager
- ENDM
-
- MACRO
- _GetSRsrc
- MOVEQ #sGetSRsrc,D0
- _SlotManager
- ENDM
-
- MACRO
- _GetTypeSRsrc
- MOVEQ #sGetTypeSRsrc,D0
- _SlotManager
- ENDM
-
-
- ;#####################################################################
- ; SPECIAL
- ;#####################################################################
- MACRO
- _SReadInfo
- MOVEQ #sReadInfo,D0
- _SlotManager
- ENDM
-
- MACRO
- _SReadPRAMRec
- MOVEQ #sReadPRAMRec,D0
- _SlotManager
- ENDM
-
- MACRO
- _SPutPRAMRec
- MOVEQ #sPutPRAMRec,D0
- _SlotManager
- ENDM
-
- MACRO
- _SReadFHeader
- MOVEQ #sReadFHeader,D0
- _SlotManager
- ENDM
-
- MACRO
- _SNextSRsrc
- MOVEQ #sNextSRsrc,D0
- _SlotManager
- ENDM
-
- MACRO
- _SNextTypeSRsrc
- MOVEQ #sNextTypeSRsrc,D0
- _SlotManager
- ENDM
-
- MACRO
- _SRsrcInfo
- MOVEQ #sRsrcInfo,D0
- _SlotManager
- ENDM
-
- MACRO
- _SDisposePtr
- MOVEQ #sDisposePtr,D0
- _SlotManager
- ENDM
-
- MACRO
- _SCkCardStat
- MOVEQ #sCkCardStat,D0
- _SlotManager
- ENDM
-
- MACRO
- _SReadDrvrName
- MOVEQ #sReadDrvrName,D0
- _SlotManager
- ENDM
-
- MACRO
- _FindSRTRec
- MOVEQ #sFindSRTRec,D0
- _SlotManager
- ENDM
-
- MACRO
- _SFindDevBase
- MOVEQ #sFindDevBase,D0
- _SlotManager
- ENDM
-
- MACRO
- _SFindBigDevBase
- MOVEQ #sFindBigDevBase,D0
- _SlotManager
- ENDM
-
- MACRO
- _GetSRsrcPtr
- MOVEQ #sGetSRsrcPtr,D0
- _SlotManager
- ENDM
-
- ;#####################################################################
- ; Advanced
- ;#####################################################################
- MACRO
- _InitSDeclMgr
- MOVEQ #initSDeclMgr,D0
- _SlotManager
- ENDM
-
- MACRO
- _SPrimaryInit
- MOVEQ #sPrimaryInit,D0
- _SlotManager
- ENDM
-
- MACRO
- _SCardChanged
- MOVEQ #sCardChanged,D0
- _SlotManager
- ENDM
-
- MACRO
- _SExec
- MOVEQ #sExec,D0
- _SlotManager
- ENDM
-
- MACRO
- _SOffsetData
- MOVEQ #sOffsetData,D0
- _SlotManager
- ENDM
-
- MACRO
- _SInitPRAMRecs
- MOVEQ #sInitPRAMRecs,D0
- _SlotManager
- ENDM
-
- MACRO
- _SReadPBSize
- MOVEQ #sReadPBSize,D0
- _SlotManager
- ENDM
-
- MACRO
- _SCalcStep
- MOVEQ #sCalcStep,D0
- _SlotManager
- ENDM
-
- MACRO
- _SInitSRsrcTable
- MOVEQ #sInitSRsrcTable,D0
- _SlotManager
- ENDM
-
- MACRO
- _SSearchSRT
- MOVEQ #sSearchSRT,D0
- _SlotManager
- ENDM
-
- MACRO
- _SUpdateSRT
- MOVEQ #sUpdateSRT,D0
- _SlotManager
- ENDM
-
- MACRO
- _SCalcSPointer
- MOVEQ #sCalcSPointer,D0
- _SlotManager
- ENDM
-
- MACRO
- _SGetDriver
- MOVEQ #sGetDriver,D0
- _SlotManager
- ENDM
-
- MACRO
- _SPtrToSlot
- MOVEQ #sPtrToSlot,D0
- _SlotManager
- ENDM
-
- MACRO
- _SFindSInfoRecPtr
- MOVEQ #sFindSInfoRecPtr,D0
- _SlotManager
- ENDM
-
- MACRO
- _SFindSRsrcPtr
- MOVEQ #sFindSRsrcPtr,D0
- _SlotManager
- ENDM
-
- MACRO
- _SDeleteSRTRec
- MOVEQ #sDeleteSRTRec,D0
- _SlotManager
- ENDM
-
- MACRO
- _SecondaryInit
- MOVEQ #sSecondaryInit,D0
- _SlotManager
- ENDM
-
- MACRO
- _InitSlotPRAM
- MOVEQ #sInitSlotPRAM,D0
- _SlotManager
- ENDM
-
- ENDIF ; ...already included